This expert system takes the books the user likes as an input and recommends similar books. The results are obtained using the genres and the author of the chosen books and return the most highly rated books in the data set that have the same genres or authors.
The data set contains 30 thousands books obtained from Goodreads site by scraping. If the user couldn't find the desired book in the data set, he/she can enter Goodreads id to obtain it. But the recommendations are always limited by the books in the dataset.
As we see in the picture below the data set is made from the following column: Book id, book title, publish year, genres of the book, number of the people rated the book, number of the book reviews, average rating, description of the book, and a link to the book img.
data.head()
#sample from the data
| book_id | book_title | year_first_published | author | genres | num_ratings | num_reviews | average_rating | desc | img | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 3721 | Stranger Than Fiction: An Independent Investig... | Albert D. Pastore | [] | 8 | 1 | 4.00 | \nThe true story behind 9-11, delivered by a m... | https://i.gr-assets.com/images/S/compressed.ph... | |
| 1 | 2833 | The Life and Death of Carthage; A Survey of Pu... | Gilbert Charles-Picard | [History] | 7 | 0 | 4.14 | None | None | |
| 2 | 24141 | El libro de Catherine/ Catherine, called Birdy | 1994 | Karen Cushman | [Historical > Historical Fiction, Young Adult,... | 40761 | 1667 | 3.72 | \nCatherine feels trapped. Her father is deter... | https://i.gr-assets.com/images/S/compressed.ph... |
| 3 | 13232 | Alice's Adventures in Wonderland | Julia Suarez | [Classics, Fantasy] | 44 | 2 | 4.18 | \nWhen Alice sees a white rabbit muttering, “I... | https://i.gr-assets.com/images/S/compressed.ph... | |
| 4 | 22996 | Federico Garcia Lorca | 1985 | Ian Gibson | [Biography, History, Cultural > Spain, Poetry,... | 253 | 13 | 4.19 | \nEsta coleccion nacio como una hermana mayor ... | None |
At first I used the Bayesian Formula to make a weighted score for the books based on the average rating and number of raters so the books rated from 1 user as 5 star is not the same as the book rated from 1000 users as 5 star.
The Bayesian Formula is as follows:
weighted rank (WR) = (v / (v+m)) R + (m / (v+m)) C
where:
R = average for the design (mean) = (Rating)
v = number of votes for the design = (Rate Count)
m = minimum votes required to be listed in the top beers list
C = the midpoint of the scale
I chose the minimum votes to be at least in the top 80%.
I sorted the data according to the new scores.
q_books.head()
| book_id | book_title | year_first_published | author | genres | num_ratings | num_reviews | average_rating | desc | img | score | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 19838 | 8 | Harry Potter Boxed Set, Books 1-5 (Harry Potte... | 2003 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 74201 | 204 | 4.78 | \nBox Set containing Harry Potter and the Sorc... | https://i.gr-assets.com/images/S/compressed.ph... | 4.571068 |
| 11880 | 4256 | Harry Potter and the Prisoner of Azkaban | 1999 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 3276006 | 64426 | 4.57 | \nFor twelve long years, the dread fortress of... | https://i.gr-assets.com/images/S/compressed.ph... | 4.565298 |
| 24125 | 5 | Harry Potter and the Prisoner of Azkaban | 1999 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 3274493 | 64408 | 4.57 | \nFor twelve long years, the dread fortress of... | https://i.gr-assets.com/images/S/compressed.ph... | 4.565295 |
| 20363 | 15872 | Harry Potter y el misterio del príncipe | 2005 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 2748459 | 45378 | 4.57 | \nCon dieciséis años cumplidos, Harry Potter i... | https://i.gr-assets.com/images/S/compressed.ph... | 4.564400 |
| 1853 | 5991 | 混血王子的背叛 | 2005 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 2745302 | 45332 | 4.57 | \n魔法部印製發行! 保護你的家庭與親人避開黑暗勢力侵襲! 第一,建議各位不要單獨出門。 第... | https://i.gr-assets.com/images/S/compressed.ph... | 4.564394 |
As we see in table above, The score column is added but we have 2 problems in the data.
q_books.head()
| book_title | book_id | year_first_published | author | genres | num_ratings | num_reviews | average_rating | desc | img | score | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | The Complete Calvin and Hobbes | 24812 | Bill Watterson | [Sequential Art > Comics, Humor, Sequential Ar... | 38253 | 1086 | 4.77 | \n[ \nBox Set\n | Book One | Book Two | Book T... | https://i.gr-assets.com/images/S/compressed.ph... | 4.596424 | |
| 1 | The Essential Calvin and Hobbes | 24817 | 1988 | Bill Watterson | [Sequential Art > Comics, Humor, Sequential Ar... | 116567 | 907 | 4.63 | \nBy the 1986 Reuben Award as Outstanding Cart... | https://i.gr-assets.com/images/S/compressed.ph... | 4.574340 |
| 2 | Harry Potter and the Prisoner of Azkaban | 4256 | 1999 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 3276006 | 64426 | 4.57 | \nFor twelve long years, the dread fortress of... | https://i.gr-assets.com/images/S/compressed.ph... | 4.568033 |
| 3 | Harry Potter and the Half-Blood Prince | 2005 | 2005 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 2744285 | 45320 | 4.57 | \nAlternate Cover Edition here.It is Harry Pot... | https://i.gr-assets.com/images/S/compressed.ph... | 4.567652 |
| 4 | Harry Potter and the Goblet of Fire | 6 | 2000 | J.K. Rowling | [Fantasy, Young Adult, Fiction, Fantasy > Magi... | 2942510 | 53663 | 4.56 | \nHarry Potter is midway through his training ... | https://i.gr-assets.com/images/S/compressed.ph... | 4.557834 |
Now the data is ready and we can complete our work on it.
The idea of my system is simple:
show_data(chosen_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | |
|---|---|---|---|---|---|---|---|
| 0 | ![]() |
The Andromeda Strain | 1969 | michaelcrichton | [sciencefiction, fiction, thriller] | 238324 | 3.91 |
| 1 | ![]() |
How to Start a Conversation and Make Friends: Revised and Updated | 1983 | dongabor | [selfhelp, nonfiction, language>communication] | 1090 | 3.61 |
| 2 | ![]() |
Crossroads and Other Tales of Valdemar | mercedeslackey | [fantasy, shortstories, anthologies] | 3295 | 3.88 | |
| 3 | ![]() |
Monique and the Mango Rains: Two Years with a Midwife in Mali | 2006 | krisholloway | [nonfiction, cultural>africa, autobiography>memoir] | 4141 | 4.17 |
| 4 | ![]() |
Arrows of the Queen | 1987 | mercedeslackey | [fantasy, youngadult, fiction] | 39808 | 4.08 |
Based on the chosen books above the lists will be as follows:
print('genres list: ' + str(genres_list) + '\n')
print('authors list: ' + str(authors_list))
genres list: ['sciencefiction', 'fiction', 'thriller', 'selfhelp', 'nonfiction', 'language>communication', 'fantasy', 'shortstories', 'anthologies', 'cultural>africa', 'autobiography>memoir', 'youngadult'] authors list: ['michaelcrichton', 'dongabor', 'mercedeslackey', 'krisholloway']
The problem with the above approach is that if the genre or author is repeated in the books the user read it will be the same as the unrepeated ones in the score and most similar recommendations will have at most 4 as a similartiy.
show_data(q_books)
#qualified books
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Jurassic Park | 1990 | michaelcrichton | [sciencefiction, fiction, thriller] | 860193 | 4.06 | 4.056590 | 4 |
| 1 | ![]() |
Queen's Own | 1990 | mercedeslackey | [fantasy, fiction, youngadult] | 7220 | 4.42 | 4.034620 | 4 |
| 2 | ![]() |
Michael Crichton's Jurassic World: Jurassic Park / The Lost World | michaelcrichton | [sciencefiction, fiction, thriller] | 10026 | 4.23 | 3.985865 | 4 | |
| 3 | ![]() |
La Amenaza de Andromeda | 1969 | michaelcrichton | [sciencefiction, fiction, thriller] | 238452 | 3.91 | 3.902146 | 4 |
| 4 | None | Timeline | 1999 | michaelcrichton | [sciencefiction, fiction, thriller] | 201379 | 3.86 | 3.852396 | 4 |
| 5 | ![]() |
Rescate en el tiempo [1999-1357] | 1999 | michaelcrichton | [sciencefiction, fiction, thriller] | 201358 | 3.86 | 3.852395 | 4 |
| 6 | ![]() |
Esfera | 1987 | michaelcrichton | [sciencefiction, fiction, thriller] | 178470 | 3.81 | 3.803308 | 4 |
| 7 | ![]() |
Le Monde Perdu | 1995 | michaelcrichton | [fiction, sciencefiction, thriller] | 139532 | 3.81 | 3.801529 | 4 |
| 8 | ![]() |
El mundo perdido | 1995 | michaelcrichton | [fiction, sciencefiction, thriller] | 139495 | 3.81 | 3.801526 | 4 |
| 9 | ![]() |
El Mundo Perdido | 1995 | michaelcrichton | [fiction, sciencefiction, thriller] | 139439 | 3.81 | 3.801523 | 4 |
| 10 | ![]() |
The Lost World | michaelcrichton | [fiction, sciencefiction, thriller] | 139439 | 3.81 | 3.801523 | 4 | |
| 11 | None | Lost World Mov Tie-In | 1995 | michaelcrichton | [fiction, sciencefiction, thriller] | 139439 | 3.81 | 3.801523 | 4 |
| 12 | ![]() |
Presa | 2002 | michaelcrichton | [fiction, sciencefiction, thriller] | 173936 | 3.77 | 3.764660 | 4 |
| 13 | ![]() |
Estado de miedo | 2004 | michaelcrichton | [fiction, thriller, sciencefiction] | 84422 | 3.71 | 3.703936 | 4 |
| 14 | ![]() |
Estado De Miedo | 2004 | michaelcrichton | [fiction, thriller, sciencefiction] | 84417 | 3.71 | 3.703935 | 4 |
| 15 | ![]() |
State Of Fear | michaelcrichton | [fiction, thriller, sciencefiction] | 84417 | 3.71 | 3.703935 | 4 | |
| 16 | ![]() |
State of Fear | 2004 | michaelcrichton | [fiction, thriller, sciencefiction] | 84411 | 3.71 | 3.703935 | 4 |
| 17 | ![]() |
Congo | 1980 | michaelcrichton | [fiction, sciencefiction, thriller] | 168757 | 3.62 | 3.620366 | 4 |
| 18 | ![]() |
Next | michaelcrichton | [fiction, sciencefiction, thriller] | 72362 | 3.55 | 3.556878 | 4 | |
| 19 | ![]() |
The Terminal Man | 1972 | michaelcrichton | [fiction, sciencefiction, thriller] | 25657 | 3.37 | 3.424756 | 4 |
So, I decided to use dictionary instead of the list and make the genres as key and the the times repeated in the list as the value of the key.
print('genres dictionary: ' + str(genres_dict) + '\n')
print('authors dictionary: ' + str(authors_dict))
genres dictionary: {'sciencefiction': 1, 'fiction': 2, 'thriller': 1, 'selfhelp': 1, 'nonfiction': 2, 'language>communication': 1, 'fantasy': 2, 'shortstories': 1, 'anthologies': 1, 'cultural>africa': 1, 'autobiography>memoir': 1, 'youngadult': 1}
authors dictionary: {'michaelcrichton': 1, 'dongabor': 1, 'mercedeslackey': 2, 'krisholloway': 1}
show_data(q_books.head(20))
#qualified books after using dictionary
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Queen's Own | 1990 | mercedeslackey | [fantasy, fiction, youngadult] | 7220 | 4.42 | 4.034620 | 7 |
| 1 | ![]() |
Arrows of the Queen | 1987 | mercedeslackey | [fantasy, youngadult, fiction] | 39808 | 4.08 | 4.013710 | 7 |
| 2 | ![]() |
Arrow's Fall | 1988 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 21630 | 4.19 | 4.054918 | 6 |
| 3 | ![]() |
Exile's Valor | 2003 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 12102 | 4.20 | 3.993444 | 6 |
| 4 | ![]() |
Winds of Fate | 1991 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 16332 | 4.05 | 3.925504 | 6 |
| 5 | ![]() |
To Light a Candle | 2004 | mercedeslackey | [fantasy, fiction, fantasy>dragons] | 9713 | 4.13 | 3.922670 | 6 |
| 6 | ![]() |
Winds of Fury | 1993 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 13502 | 4.07 | 3.921465 | 6 |
| 7 | ![]() |
When Darkness Falls | 2006 | mercedeslackey | [fantasy, fiction, fantasy>magic] | 7391 | 4.18 | 3.914823 | 6 |
| 8 | ![]() |
Storm Warning | 1994 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 12637 | 4.05 | 3.901918 | 6 |
| 9 | ![]() |
Storm Rising | 1995 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 12032 | 4.04 | 3.890810 | 6 |
| 10 | ![]() |
Joust | 2003 | mercedeslackey | [fantasy, fantasy>dragons, fiction] | 11282 | 4.03 | 3.878428 | 6 |
| 11 | ![]() |
The Serpent's Shadow | 2001 | mercedeslackey | [fantasy, fiction, romance] | 10241 | 4.01 | 3.857232 | 6 |
| 12 | ![]() |
Owlflight | 1997 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 10649 | 4.00 | 3.854710 | 6 |
| 13 | ![]() |
Alta | 2004 | mercedeslackey | [fantasy, fantasy>dragons, fiction] | 7944 | 4.04 | 3.849629 | 6 |
| 14 | ![]() |
Phoenix and Ashes | 2004 | mercedeslackey | [fantasy, fantasy>fairytales, fiction] | 7983 | 4.03 | 3.844753 | 6 |
| 15 | ![]() |
Owlknight | 1999 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 9213 | 4.00 | 3.841735 | 6 |
| 16 | ![]() |
The Silver Gryphon | 1996 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 10574 | 3.84 | 3.757076 | 6 |
| 17 | ![]() |
The Wizard of London | 2005 | mercedeslackey | [fantasy, fiction, fantasy>fairytales] | 7078 | 3.81 | 3.721058 | 6 |
| 18 | ![]() |
Harry Potter and the Prisoner of Azkaban | 1999 | j.k.rowling | [fantasy, youngadult, fiction] | 3276006 | 4.57 | 4.568033 | 5 |
| 19 | ![]() |
Harry Potter and the Half-Blood Prince | 2005 | j.k.rowling | [fantasy, youngadult, fiction] | 2744285 | 4.57 | 4.567652 | 5 |
show_chart(chosen_books) #Above chart the books chosen by user
show_chart(q_books.head(20)) #below chart The books recomended
Now if we see the charts above we notice that all the books recomended have the the genres fantasy and fiction which means that the recomindations lack of diversity.
I decided to limit the genres occurance in the recomindations to be at most 33% of the books which means just 7 books will have the same genre in the recomindations.
show_data(r_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Queen's Own | 1990 | mercedeslackey | [fantasy, fiction, youngadult] | 7220 | 4.42 | 4.034620 | 7 |
| 1 | ![]() |
Arrow's Fall | 1988 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 21630 | 4.19 | 4.054918 | 6 |
| 2 | ![]() |
Exile's Valor | 2003 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 12102 | 4.20 | 3.993444 | 6 |
| 3 | ![]() |
Winds of Fate | 1991 | mercedeslackey | [fantasy, fiction, sciencefictionfantasy] | 16332 | 4.05 | 3.925504 | 6 |
| 4 | ![]() |
To Light a Candle | 2004 | mercedeslackey | [fantasy, fiction, fantasy>dragons] | 9713 | 4.13 | 3.922670 | 6 |
| 5 | ![]() |
Out of Africa / Shadows on the Grass | 1937 | isakdinesen | [nonfiction, cultural>africa, autobiography>memoir] | 10832 | 4.23 | 3.996983 | 4 |
| 6 | ![]() |
Don't Let's Go to the Dogs Tonight: An African Childhood | 2001 | alexandrafuller | [autobiography>memoir, nonfiction, cultural>africa] | 55646 | 3.93 | 3.896980 | 4 |
| 7 | ![]() |
Couldn't Keep it to Myself: Wally Lamb and the Women of York Correctional Institution | 2003 | wallylamb | [nonfiction, autobiography>memoir, shortstories] | 7145 | 4.09 | 3.864271 | 4 |
| 8 | ![]() |
How to be Alone | 2002 | jonathanfranzen | [nonfiction, autobiography>memoir, shortstories] | 11191 | 3.59 | 3.604970 | 4 |
| 9 | ![]() |
On Writing: A Memoir | 2000 | stephenking | [nonfiction, language>writing, autobiography>memoir] | 251994 | 4.31 | 4.291947 | 3 |
| 10 | ![]() |
On Writing: A Memoir of the Craft | 2000 | stephenking | [nonfiction, language>writing, autobiography>memoir] | 251899 | 4.31 | 4.291940 | 3 |
| 11 | ![]() |
The House of the Scorpion | nancyfarmer | [youngadult, sciencefiction, sciencefiction>dystopia] | 92876 | 4.04 | 4.011733 | 2 | |
| 12 | ![]() |
Uglies | scottwesterfeld | [youngadult, sciencefiction>dystopia, sciencefiction] | 610399 | 3.85 | 3.847546 | 2 | |
| 13 | ![]() |
Pretties | scottwesterfeld | [youngadult, sciencefiction>dystopia, sciencefiction] | 250871 | 3.84 | 3.834389 | 2 | |
| 14 | ![]() |
Specials | scottwesterfeld | [youngadult, sciencefiction>dystopia, sciencefiction] | 181789 | 3.76 | 3.755246 | 2 | |
| 15 | ![]() |
Transmetropolitan, Vol. 10: One More Time | warrenellis | [sequentialart>comics, sequentialart>graphicnovels, sciencefiction] | 11180 | 4.52 | 4.181140 | 1 | |
| 16 | ![]() |
Transmetropolitan, Vol. 3: Year of the Bastard | warrenellis | [sequentialart>comics, sequentialart>graphicnovels, sciencefiction] | 14923 | 4.41 | 4.164013 | 1 | |
| 17 | ![]() |
Secrets of the Millionaire Mind: Mastering the Inner Game of Wealth | 2005 | t.harveker | [business, economics>finance, selfhelp] | 52896 | 4.18 | 4.116739 | 1 |
| 18 | ![]() |
Unlimited Power: The New Science Of Personal Achievement | 1986 | anthonyrobbins | [selfhelp, selfhelp>personaldevelopment, psychology] | 32846 | 4.20 | 4.101341 | 1 |
| 19 | ![]() |
Beyond Reach | karinslaughter | [mystery, thriller, mystery>crime] | 30308 | 4.19 | 4.086452 | 1 |
show_chart(chosen_books) #Above chart the books chosen by user
show_chart(r_books) #below chart The books recomended
titles = ["Middlemarch: Part 1 & Part 2"]
chosen_books = read_data(titles)
chosen_books = chosen_books.reset_index(drop=True)
r_books = recomend_books(q_books, titles)
show_data(chosen_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | |
|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Middlemarch: Part 1 & Part 2 | 1871 | georgeeliot | [classics, fiction, historical>historicalfiction] | 144797 | 3.99 |
show_data(r_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Middlemarch | 1871 | georgeeliot | [classics, fiction, historical>historicalfiction] | 144797 | 3.99 | 3.973674 | 4 |
| 1 | ![]() |
Adam Bede | 1859 | georgeeliot | [classics, fiction, historical>historicalfiction] | 23824 | 3.80 | 3.761826 | 4 |
| 2 | ![]() |
East Of Eden | 1952 | johnsteinbeck | [classics, fiction, historical>historicalfiction] | 466848 | 4.38 | 4.369120 | 3 |
| 3 | ![]() |
East of Eden | 1952 | johnsteinbeck | [classics, fiction, historical>historicalfiction] | 466753 | 4.38 | 4.369118 | 3 |
| 4 | ![]() |
Gone with the Wind | 1936 | margaretmitchell | [classics, historical>historicalfiction, fiction] | 1139318 | 4.30 | 4.295983 | 3 |
| 5 | ![]() |
The Complete Calvin and Hobbes | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 38253 | 4.77 | 4.596424 | 0 | |
| 6 | ![]() |
The Essential Calvin and Hobbes | 1988 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 116567 | 4.63 | 4.574340 | 0 |
| 7 | ![]() |
The Calvin And Hobbes: Tenth Anniversary Book | 1995 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 51863 | 4.60 | 4.486524 | 0 |
| 8 | ![]() |
The Calvin and Hobbes Tenth Anniversary Book | 1995 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 51862 | 4.60 | 4.486522 | 0 |
| 9 | ![]() |
The Complete Maus | 1994 | artspiegelman | [sequentialart>graphicnovels, sequentialart>comics, nonfiction] | 167386 | 4.52 | 4.484907 | 0 |
| 10 | ![]() |
It's A Magical World | 1996 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 28087 | 4.68 | 4.473619 | 0 |
| 11 | ![]() |
Man's Search for Meaning | 1946 | viktore.frankl | [nonfiction, psychology, philosophy] | 516794 | 4.35 | 4.340551 | 0 |
| 12 | ![]() |
The Kissing Hand | 1993 | audreypenn | [childrens>picturebooks, childrens, animals] | 67213 | 4.41 | 4.337647 | 0 |
| 13 | ![]() |
The Night Before Christmas | 1823 | clementc.moore | [holiday>christmas, childrens, childrens>picturebooks] | 115885 | 4.37 | 4.328573 | 0 |
| 14 | ![]() |
The Lord of the Rings: The Making of the Movie Trilogy | 2002 | briansibley | [nonfiction, culture>film, art] | 19090 | 4.58 | 4.328535 | 0 |
| 15 | ![]() |
Mere Christianity | 1942 | c.s.lewis | [christian, nonfiction, religion] | 341609 | 4.32 | 4.306393 | 0 |
| 16 | ![]() |
Ender's Game | 1985 | orsonscottcard | [sciencefiction, youngadult, fantasy] | 1235916 | 4.30 | 4.296295 | 0 |
| 17 | ![]() |
On Writing: A Memoir | 2000 | stephenking | [nonfiction, language>writing, autobiography>memoir] | 251994 | 4.31 | 4.291947 | 0 |
| 18 | ![]() |
On Writing: A Memoir of the Craft | 2000 | stephenking | [nonfiction, language>writing, autobiography>memoir] | 251899 | 4.31 | 4.291940 | 0 |
| 19 | ![]() |
Disney's Beauty and the Beast | 1991 | teddyslater | [childrens, childrens>picturebooks, fantasy>fairytales] | 30589 | 4.42 | 4.275067 | 0 |
show_chart(chosen_books) #Above chart the books chosen by user
show_chart(r_books) #below chart The books recomended
titles = ["Middlemarch: Part 1 & Part 2", "George Washington's Rules of Civility & Decent Behavior in Company and Conversation"]
chosen_books = read_data(titles)
chosen_books = chosen_books.reset_index(drop=True)
r_books = recomend_books(q_books, titles)
show_data(chosen_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | |
|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Middlemarch: Part 1 & Part 2 | 1871 | georgeeliot | [classics, fiction, historical>historicalfiction] | 144797 | 3.99 |
| 1 | ![]() |
George Washington's Rules of Civility & Decent Behavior in Company and Conversation | 1887 | georgewashington | [history, nonfiction, classics] | 1502 | 4.09 |
show_data(r_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Middlemarch | 1871 | georgeeliot | [classics, fiction, historical>historicalfiction] | 144797 | 3.99 | 3.973674 | 5 |
| 1 | ![]() |
Adam Bede | 1859 | georgeeliot | [classics, fiction, historical>historicalfiction] | 23824 | 3.80 | 3.761826 | 5 |
| 2 | ![]() |
East Of Eden | 1952 | johnsteinbeck | [classics, fiction, historical>historicalfiction] | 466848 | 4.38 | 4.369120 | 4 |
| 3 | ![]() |
East of Eden | 1952 | johnsteinbeck | [classics, fiction, historical>historicalfiction] | 466753 | 4.38 | 4.369118 | 4 |
| 4 | ![]() |
Night | 1956 | eliewiesel | [nonfiction, classics, history] | 1069764 | 4.34 | 4.335468 | 4 |
| 5 | ![]() |
The Book Thief | 2005 | markuszusak | [historical>historicalfiction, fiction, youngadult] | 2096334 | 4.38 | 4.377550 | 2 |
| 6 | ![]() |
If This Is a Man & The Truce | 1987 | primolevi | [nonfiction, history, biography] | 17306 | 4.53 | 4.274178 | 2 |
| 7 | ![]() |
Long Walk to Freedom: Autobiography of Nelson Mandela | 1994 | nelsonmandela | [biography, nonfiction, history] | 80486 | 4.28 | 4.228859 | 2 |
| 8 | ![]() |
Long Walk to Freedom: The Autobiograpy of Nelson Mandela with Connections | 1994 | nelsonmandela | [biography, nonfiction, history] | 80486 | 4.28 | 4.228859 | 2 |
| 9 | ![]() |
Long Walk To Freedom | 1994 | nelsonmandela | [biography, nonfiction, history] | 27437 | 4.37 | 4.221757 | 2 |
| 10 | ![]() |
Team of Rivals: The Political Genius of Abraham Lincoln | doriskearnsgoodwin | [history, nonfiction, biography] | 178598 | 4.22 | 4.198134 | 2 | |
| 11 | ![]() |
The Complete Calvin and Hobbes | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 38253 | 4.77 | 4.596424 | 0 | |
| 12 | ![]() |
The Essential Calvin and Hobbes | 1988 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 116567 | 4.63 | 4.574340 | 0 |
| 13 | ![]() |
The Calvin And Hobbes: Tenth Anniversary Book | 1995 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 51863 | 4.60 | 4.486524 | 0 |
| 14 | ![]() |
The Calvin and Hobbes Tenth Anniversary Book | 1995 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 51862 | 4.60 | 4.486522 | 0 |
| 15 | ![]() |
It's A Magical World | 1996 | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 28087 | 4.68 | 4.473619 | 0 |
| 16 | ![]() |
It's a Magical World | billwatterson | [sequentialart>comics, humor, sequentialart>graphicnovels] | 28084 | 4.68 | 4.473601 | 0 | |
| 17 | ![]() |
The Kissing Hand | 1993 | audreypenn | [childrens>picturebooks, childrens, animals] | 67213 | 4.41 | 4.337647 | 0 |
| 18 | ![]() |
The Night Before Christmas | 1823 | clementc.moore | [holiday>christmas, childrens, childrens>picturebooks] | 115885 | 4.37 | 4.328573 | 0 |
| 19 | ![]() |
Ender's Game | 1985 | orsonscottcard | [sciencefiction, youngadult, fantasy] | 1235916 | 4.30 | 4.296295 | 0 |
show_chart(chosen_books) #Above chart the books chosen by user
show_chart(r_books) #below chart The books recomended
titles = ["Middlemarch: Part 1 & Part 2","George Washington's Rules of Civility & Decent Behavior in Company and Conversation", "Bowling Alone: The Collapse and Revival of American Community", "The Andromeda Strain","How to Start a Conversation and Make Friends: Revised and Updated",'Crossroads and Other Tales of Valdemar', 'Monique and the Mango Rains: Two Years with a Midwife in Mali', 'Arrows of the Queen'"The Prince","The Idiot Brain: A Neuroscientist Explains What Your Head is Really Up To","Because Internet: Understanding the New Rules of Language","What Men Live By","We Are Bellingcat: Global Crime, Online Sleuths, and the Bold Future of News","Durkheim Is Dead!: Sherlock Holmes Is Introduced to Social Theory: Sherlock Holmes Is Introduced to Social Theory","1984","Animal Farm","The Master and Margarita","Permanent Record"]
chosen_books = read_data(titles)
chosen_books = chosen_books.reset_index(drop=True)
r_books = recomend_books(q_books, titles)
show_data(chosen_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | |
|---|---|---|---|---|---|---|---|
| 0 | ![]() |
Middlemarch: Part 1 & Part 2 | 1871 | georgeeliot | [classics, fiction, historical>historicalfiction] | 144797 | 3.99 |
| 1 | ![]() |
George Washington's Rules of Civility & Decent Behavior in Company and Conversation | 1887 | georgewashington | [history, nonfiction, classics] | 1502 | 4.09 |
| 2 | ![]() |
Bowling Alone: The Collapse and Revival of American Community | 2000 | robertd.putnam | [nonfiction, sociology, politics] | 6051 | 3.82 |
| 3 | ![]() |
The Andromeda Strain | 1969 | michaelcrichton | [sciencefiction, fiction, thriller] | 238324 | 3.91 |
| 4 | ![]() |
How to Start a Conversation and Make Friends: Revised and Updated | 1983 | dongabor | [selfhelp, nonfiction, language>communication] | 1090 | 3.61 |
| 5 | ![]() |
Crossroads and Other Tales of Valdemar | mercedeslackey | [fantasy, shortstories, anthologies] | 3295 | 3.88 | |
| 6 | ![]() |
Monique and the Mango Rains: Two Years with a Midwife in Mali | 2006 | krisholloway | [nonfiction, cultural>africa, autobiography>memoir] | 4141 | 4.17 |
| 7 | ![]() |
The Idiot Brain: A Neuroscientist Explains What Your Head is Really Up To | deanburnett | [nonfiction, science, psychology] | 7286 | 3.99 | |
| 8 | ![]() |
Because Internet: Understanding the New Rules of Language | gretchenmcculloch | [nonfiction, humanities>linguistics, humanities>language] | 8815 | 4.06 | |
| 9 | ![]() |
What Men Live By | 1885 | leotolstoy | [classics, fiction, shortstories] | 12855 | 4.01 |
| 10 | ![]() |
We Are Bellingcat: Global Crime, Online Sleuths, and the Bold Future of News | eliothiggins | [nonfiction, politics, writing>journalism] | 1398 | 4.11 | |
| 11 | ![]() |
Durkheim Is Dead!: Sherlock Holmes Is Introduced to Social Theory: Sherlock Holmes Is Introduced to Social Theory | 2003 | arthurasaburger | [sociology, philosophy>theory] | 104 | 3.27 |
| 12 | ![]() |
1984 | 1949 | georgeorwell | [classics, fiction, sciencefiction] | 3664053 | 4.19 |
| 13 | ![]() |
Animal Farm | 1999 | danielmoran | [classics] | 84 | 3.96 |
| 14 | ![]() |
The Master and Margarita | 1967 | mikhailbulgakov | [classics, fiction, cultural>russia] | 280311 | 4.29 |
| 15 | ![]() |
Permanent Record | edwardsnowden | [nonfiction, biography, politics] | 42604 | 4.28 |
show_data(r_books)
| img | book_title | year_first_published | author | genres | num_ratings | average_rating | score | sim_score | |
|---|---|---|---|---|---|---|---|---|---|
| 0 | None | Down And Out In Paris And London | 1933 | georgeorwell | [nonfiction, classics, autobiography>memoir] | 76139 | 4.05 | 4.015206 | 16 |
| 1 | ![]() |
Night | 1956 | eliewiesel | [nonfiction, classics, history] | 1069764 | 4.34 | 4.335468 | 15 |
| 2 | ![]() |
Schindler's List | 1982 | thomaskeneally | [history, nonfiction, classics] | 156820 | 4.31 | 4.281450 | 15 |
| 3 | None | Schindler's List (Unabridged) | 1982 | thomaskeneally | [history, nonfiction, classics] | 156820 | 4.31 | 4.281450 | 15 |
| 4 | ![]() |
I Know Why the Caged Bird Sings | 1969 | mayaangelou | [nonfiction, classics, autobiography>memoir] | 462348 | 4.25 | 4.240918 | 15 |
| 5 | ![]() |
The Souls of Black Folk | 1903 | w.e.b.dubois | [nonfiction, history, classics] | 39174 | 4.28 | 4.182971 | 15 |
| 6 | ![]() |
The Illustrated Man | 1951 | raybradbury | [sciencefiction, shortstories, fiction] | 89994 | 4.11 | 4.075930 | 9 |
| 7 | ![]() |
Jurassic Park | 1990 | michaelcrichton | [sciencefiction, fiction, thriller] | 860193 | 4.06 | 4.056590 | 9 |
| 8 | None | Welcome to the Monkey House | 1968 | kurtvonnegutjr. | [fiction, shortstories, sciencefiction] | 58746 | 4.10 | 4.050751 | 9 |
| 9 | ![]() |
Michael Crichton's Jurassic World: Jurassic Park / The Lost World | michaelcrichton | [sciencefiction, fiction, thriller] | 10026 | 4.23 | 3.985865 | 9 | |
| 10 | ![]() |
The Cyberiad (Fables for the Cybernetic Age) | 1965 | stanisławlem | [sciencefiction, fiction, shortstories] | 11036 | 4.17 | 3.962651 | 9 |
| 11 | ![]() |
The Cyberiad | 1965 | stanisławlem | [sciencefiction, fiction, shortstories] | 11034 | 4.17 | 3.962627 | 9 |
| 12 | ![]() |
The Origins of Totalitarianism | 1951 | hannaharendt | [history, philosophy, politics] | 9737 | 4.30 | 4.022668 | 4 |
| 13 | ![]() |
The Road to Serfdom | 1944 | friedricha.hayek | [economics, politics, philosophy] | 20746 | 4.17 | 4.035567 | 3 |
| 14 | ![]() |
The Door in the Hedge | 1981 | robinmckinley | [fantasy, youngadult, shortstories] | 9327 | 3.69 | 3.664292 | 3 |
| 15 | ![]() |
Voyager | 1993 | dianagabaldon | [historical>historicalfiction, romance, fantasy] | 281245 | 4.36 | 4.342588 | 2 |
| 16 | ![]() |
Dragonfly in Amber | 1992 | dianagabaldon | [historical>historicalfiction, romance, fantasy] | 315765 | 4.32 | 4.305302 | 2 |
| 17 | ![]() |
Drums of Autumn | 1996 | dianagabaldon | [historical>historicalfiction, romance, fantasy] | 228672 | 4.32 | 4.299868 | 2 |
| 18 | ![]() |
Cross Stitch | 1991 | dianagabaldon | [historical>historicalfiction, romance, fantasy] | 919923 | 4.24 | 4.235476 | 2 |
| 19 | ![]() |
Son of the Shadows | 2000 | julietmarillier | [fantasy, romance, historical>historicalfiction] | 29213 | 4.33 | 4.196667 | 2 |
show_chart(chosen_books) #Above chart the books chosen by user
show_chart(r_books) #below chart The books recomended